Outside Europe where transition altitudes/levels are as high as FL180 you MUST set STD or QNH at the transition altitude/level and not before
You should not set it when cleared, as in the UK. At our airline we call passing transition both up and down and carry out an altimeter check.
Operating into UK airports we set it when cleared, as described above.