X-ray study of phase transitions of NH4BeF3