Topological transitions of fast ion orbits in toroidal plasmas