Under GAE the current way to make heroes is to use a custom invisible resource.
Make a new static resource called "heroes" (or whatever you want) and set it to the maximum number or heroes you want.
Make each hero cost 1 resource point. Since the resources is static type (rather than tech or tileset) when a hero unit dies it can be built again.
If you want a more complex setup like having 3 heroes which can only be built one of each type you will need to set up a resource for each hero.
This link might be handy:
https://docs.megaglest.org/GAE/Resource_XML