When a high electron mobility transistor is illuminated, the absorbed photons excite electron-hole pairs. The generated pairs are separated by the built in field in such a way that the electrons end up in the quantum well generating a photocurrent, while together with the holes that are swept towards the gate they generate a surface photovoltage. Here, we define photon-induced transconductance as the ratio between the surface photovoltage and the 2DEG photocurrent under identical illumination conditions. We show that this ratio directly yields the channel mobility and the 2DEG sheet charge density. The photocurrent and photovoltage may vary with the wavelength of the exciting photons. We examine and analyze optical spectra of this photon-induced transconductance obtained from an AlGaN/GaN heterostructure for a range of photon energies showing that the mobility is obtained only for excitation at photon energies above the wide bandgap energy. The method offers an optical alternative to Hall effect and to field effect mobility. Unlike Hall effect, it may be measured in the transistor itself. The only alternative that can measure mobility in the transistor itself measures field effect mobility, while the proposed method mesures the same conductivity mobility as measured by Hall effect.