Mechanistic analysis of the transition metal-catalyzed hydrogenation of imines and functionalized enamines