Anisotropic cosmological dynamics in Einstein–Gauss–Bonnet gravity: an example of dynamical compactification in $$7+1$$ dimensions