Anisotropic Goos–Hänchen shift in few-layer two-dimensional materials