A model for the origin of group reproduction during the evolutionary transition to multicellularity