The energetics of the trot–gallop transition