Generalizing Graph ODE for Learning Complex System Dynamics across Environments