Coupled longitudinal and transverse self-organization in lasers induced by transverse-mode locking