Formation of two-dimensional electron gas at AlGaN