Theoretical and experimental investigation of the electron spin resonance of Co2+ in Zn2(OH)PO4 and Mg2(OH)AsO4