Recent experimental observations have found toroidally localized MHD instabilities in the plasma edge during operation with applied magnetic perturbations on ASDEX Upgrade in H-mode with low collisionality (ν ≈ 0.4). Large edge plasma displacements are induced by a stable kink response to the 3D magnetic perturbations. This kink response results in localized changes of geometric quantities, which in turn leads to the localization of MHD instabilities in the plasma edge. Infinite-n ideal MHD ballooning theory is shown to predict the existence of these instabilities, as well as the observed toroidal localization. Utilizing 3D VMEC equilibria, the local geometric parameters determining ideal stability, include the local magnetic shear, normal curvature, and geodesic curvature, are calculated for experimentally relevant conditions. It is found that these shaping parameters have significant levels of 3D variation, with the local magnetic shear being the dominant factor behind changes in the local geometry. This behavior leads to a significant decrease in the stabilizing line-bending energy for certain field lines, resulting in the localization of the ballooning instability. Furthermore, it is observed that a finite amount of magnetic perturbation (and subsequent edge perturbation) is necessary to modify the local geometry and excite the localized instability, leading to a threshold behavior.