For an endurance sport such as triathlon, you’re looking to produce as evenly paced an effort as possible over the whole event, whether sprint, Olympic or Ironman distance. Hills on a course act to disrupt your even-paced effort, so the trick here is to try and keep such disruption to a minimum.
You do this by staying seated as much as possible and changing down gear on climbs to allow you to keep your power output constant. This technique should be your initial response to an approaching climb, and is easy to adopt on shallow gradients (<5%) or where you get a ‘run into’ the hill. Steeper climbs and/or a ‘turn’ into a climb, however, can mean you lose too much momentum to stay seated on the first part of the hill. In this case, carry as much seated speed as you can into the hill before standing up, allowing you to keep your optimum pedalling speed (cadence), before re-positioning yourself back in the saddle and changing down gear.
So staying seated is the general rule, but stand up for little bursts: a) in order to increase any flagging momentum, as the gradient gets steeper, or b) to ease your back/shoulders (especially in longer events).
When climbing seated, keep the power output that you were producing on the flat (but in a smaller gear), and aim to sit further back in the saddle, relax your arms, drop your heels through the pedalling circle, look ahead and steady your breathing.
Good ‘standing’ technique requires you to lay the weight of your upper body onto the handlebars through relaxed arms and a slight lean forward. Keep shoulders relaxed and swing the bike from side-to-side a little in order to add some valuable body weight through each pedal down stroke.