Localization of electrons in the two-dimensional electron gas at the LaAlO$_3$/SrTiO$_3$ interface is investigated by varying the channel thickness in order to establish the nature of the conducting channel. Layers of SrTiO$_3$ were grown on NdGaO$_3$ (110) substrates and capped with LaAlO$_3$. When the SrTiO$_3$ thickness is $leq 6$ unit cells, most electrons at the interface are localized, but when the number of SrTiO$_3$ layers is 8-16, the free carrier density approaches $3.3 times 10^{14}$ cm$^{-2}$, the value corresponding to charge transfer of 0.5 electron per unit cell at the interface. The number of delocalized electrons decreases again when the SrTiO$_3$ thickness is $geq 20$ unit cells. The $sim{4}$ nm conducting channel is therefore located significantly below the interface. The results are explained in terms of Anderson localization and the position of the mobility edge with respect to the Fermi level.