Theory of transverse modes in end-pumped microchip lasers