THE HUBBLE SEQUENCE IN GROUPS: THE BIRTH OF THE EARLY-TYPE GALAXIES