Dynamics of heavy-ion transfer reactions