Effect of lattice deformation and phase transitions on the electronic spectra of TlGaS2, TlGaSe2, and TlInS2 layered semiconductors