Evolutionary mechanisms of viral cross-species transmission and emergence