Trajectory Induced Preference Optimization