We present the generalized parton distributions (GPDs) for the valence quarks of the pion and the kaon in both momentum space and position space within the basis light-front quantization framework. These GPDs are obtained from the eigenvectors of a light-front effective Hamiltonian consisting of the holographic quantum chromodynamics (QCD) confinement potential, a complementary longitudinal confinement potential, and the color-singlet Nambu-Jona--Lasinio interactions for the valence quarks of mesons. We then calculate the generalized form factors of the pion and the kaon from the moments of these GPDs. Combining the tensor form factors with the electromagnetic form factors, we subsequently evaluate the impact parameter dependent probability density of transversely polarized quarks inside the pion and the kaon. The numerical results for the generalized form factors, corresponding charges, as well as those for the probability densities and the transverse shift of the polarized densities are consistent with lattice QCD simulations and with chiral quark models.