Learning Generalizable Robot Skills for Dynamic and Interactive Tasks