Learning Cooperative Trajectory Representations for Motion Forecasting