Thermoacoustic instabilities in turbulent combustors have disastrous consequences and present notorious challenges in their modeling, prediction, and control. Such instabilities are characterized by self-excited periodic oscillations, arising from a positive feedback between the acoustic pressure and heat release rate fluctuations. We present a mean-field approach to model thermoacoustic transitions. The nonlinear flame response is modeled using an ensemble of phase oscillators constrained to collectively evolve at the rhythm of acoustic fluctuations. Starting from the acoustic wave equation coupled with the phase oscillators, we derive the evolution equations for the amplitude and phase for acoustic oscillations. The model captures abrupt and continuous transitions to thermoacoustic instability observed in disparate combustors. We also discover that continuous and abrupt transitions happen through paradigmatic continuous and explosive synchronization, respectively. Importantly, our approach explains spatiotemporal synchronization and pattern formation underlying the transition to thermoacoustic instability. The versatility of the model in capturing different types of transitions suggests promising prospects for its extension to encompass a wide range of fluid dynamics phenomena.