Elucidation of the rotary mechanism of serine recombinases