Think of upgrading heroes as just accepting level-ups. Heroes will accumulate experience points through completed projects in your city while they're in the mayor position, as well as from successful battles either attacking NPCs and valleys, or attacking or defending other players. When they've got enough exp to level up at least once, the "upgrade" button next to their portraits when you view them in the feasting hall will turn black instead of being greyed out. When you click this, you'll get an extra stat point to distribute, and the hero's salary will rise slightly due to their increase in level. Be sure to distribute the stat point carefully -- if it's an attack hero, add it to attack, if it's politics, add it to politics, etc. There's NO REASON to add to the other stats, just the one your hero specializes in. These experience points don't hold over when you dismiss the hero and hire a new one -- any exp/potential upgrades a hero has earned disappears with them when you dismiss them.