I know NovaEd has this kind of team based projects/collaborations. Students there pick a team to join in, mainly based on their interest. Maybe that is a good place to understand how such teams form.
I'm also very interested in online teamwork and recently i am trying to figure out what kinds of roles a team member functions to collaborate with others to finish a task. Some interesting findings to share with you : (1) when i applied my model (which identifies roles in teamwork) to the NovaEd datasets, i can find the leader is one important role that contributes to teamwork quality. If a team has a very good leader, then it is more likely to perform well. (2) Well, i do see some evidence that a team has a leader and co-leader in the dataset, especially in this case -- at the very beginning, there is only one leader, and he/she guides the whole team. As time goes on, this "leader" gradually becomes less motivated and less active. Then a co-leader appears. There are some messages like "I am so happy to have you as a co-leader", "thanks for saving our team", etc. I think this might be something related to team formation that you want.
Hope this could help.