Let $\mathfrak{X}$ be a class finite groups closed under taking subgroups, homomorphic images, and extensions, and let $\mathrm{k}_{\mathfrak{X}}(G)$ be the number of conjugacy classes $\mathfrak{X}$-maximal subgroups of a finite group $G$. The natural problem calling for a description, up to conjugacy, of the $\mathfrak{X}$-maximal subgroups of a given finite group is not inductive. In particular, generally speaking, the image of an $\mathfrak{X}$-maximal subgroup is not $\mathfrak{X}$-maximal in the image of a homomorphism. Nevertheless, there exist group homomorphisms that preserve the number of conjugacy classes of maximal $\mathfrak{X}$-subgroups (for example, the homomorphisms whose kernels are $\mathfrak{X}$-groups). Under such homomorphisms, the image of an $\mathfrak{X}$-maximal subgroup is always $\mathfrak{X}$-maximal, and, moreover, there is a natural bijection between the conjugacy classes of $\mathfrak{X}$-maximal subgroups of the image and preimage. In the present paper, all such homomorphisms are completely described. More precisely, it is shown that, for a homomorphism $\phi$ from a group $G$, the equality $\mathrm{k}_{\mathfrak{X}}(G)=\mathrm{k}_{\mathfrak{X}}(\operatorname{im} \phi)$ holds if and only if $\mathrm{k}_{\mathfrak{X}}(\ker \phi)=1$, which in turn is equivalent to the fact that the composition factors of the kernel of $\phi$ lie in an explicitly given list.