We study the transverse mode selection of a weakly index-guided vertical-cavity surface-emitting laser (VCSEL), based on an extension of the model of Valle et al. [Opt. Commun. 115 (1995) 297]. In the model we incorporate carrier capture and escape processes between the separate confinement heterostructure (SCH) layer and the quantum well (QW) active region of a VCSEL. These effects are characterized with phenomenological capture and escape times, τ cap, τ esc. We show analytically and by numerical simulations that when the carrier loss in the SCH region is taken into account, carrier capture and escape critically affects the transverse-mode selection of a VCSEL. A large ratio between τ cap and τ esc diminishes the number of photons in the QWs, leading to a decrease of the spatial-hole burning, which in turn benefits emission on the fundamental transverse mode. On the contrary, a small ratio between τ cap and τ esc increases the number of photons in the QWs, leading to a large spatial-hole burning which in turn favors higher-order transverse modes. If the carrier loss in the SCH region is neglected the total number of photons in the QW region is independent of τ cap and τ esc. In this case carrier capture and escape play no fundamental role in the transverse-mode selection of the VCSEL, but modify the transient dynamics of the relaxation oscillations.