Quasidiabatic states for intramolecular charge transfer. Application to the protonation of NH3