Description of magnetic moments within the Gogny Hartree-Fock-Bogolyubov framework: Application to Hg isotopes