We want to level up the hero, not the town!
But the town also needs to be upgraded. Why not give the hero a bonus for building a castle? After all, he worked hard, fought, and built it.
Great Sage - The hero starts at level 5 and has a leveled-up racial skill (if this is not possible, then give the amount of experience needed to reach level 5). Gains more experience than other heroes. Receives a bonus to knowledge based on the formula (x+y+0.5z)/7, where x is attack, y is defense, and z is magic.