Characterizing hydrogen storage behavior of Mg-based materials catalyzed by S2− and O2− ions