Learning the effective order of a hypergraph dynamical system