The superionic phase transition in hydrogen-bonded systems of the M3H(XO4)2 class: the effect of nearest-O(2) distortions on the proton dynamics