Whenever you upgrade a unit that has more than 10 exp it is reduced to 10 exp, but keeps any promotions it already has. So, as madscientist says, if you have a unit on 15 or 16 exp, it makes sense to get to 17 and take the promotion before upgrading.