The phase transition to infinite cycles in the random stirring model on trees