Buy the upgrades from your buildings. The armory is one of the main sources, and advancing an age is a purchase rather than a build action.
Budget for it in advance — each age costs a rising amount of resources, and the classic mistake is spending everything on units and then sitting unable to advance while your opponent moves up a tier.