Per-domain orces are stored in rvec *f and global forces in rvec *f_global. Likely you can apply whatever operations you need on *f, which get collected at the end of the MD step.
You may be interested in a similar (or the same?) work done before. Check https://github.com/GiovanniBussi/plumed2/blob/v2.0-hrex/user-doc/tutorials/hrex.txt and the paper http://arxiv.org/abs/1307.5144.
How is the forces stored in f_global? Like for instance if I have 4 replicas, f_global would have 4*natoms elements? I have a different scaling factor for different replicas.
You'll have to look into the code in repl_ex.c to see how that information is passed, though none of that relies on forces, so you'll have to modify it.
This discussion is better posted to the gmx-developers mailing list. Few of the GROMACS developers pay attention to RG, so it's probably not the best forum for detailed discussions of the code.
You won't find either in an .xtc because it only saves coordinates. Forces are written to the .trr file, if nstfout != 0. Energies have to be written to the .edr file.