Learning Collective Behaviors from Observation