Theory of magnetocrystalline anisotropy in equiatomic ferrous compounds along the Bain path