At level 35 you will gain a building that will allow you to learn talents for your main hero. Every five levels of the building gives you one talent point to spend, up to a maximum of 20 talent points.
You can only learn talents from one tree at a time. You must pay diamonds to switch between the trees, but your first switch is given to you free.
Each race has a different talent structure:
Tribals - Sacrificial Grounds
Nobles - Fort of Greatness
Mercenaries - Hunter's Den