Generalized Flow Matching for Transition Dynamics Modeling