First: Make sure the plate of the bridge is parallel to the top of the guitar. Level so to speak. If it isn't you'll have to adjust the tension springs in the back of the guitar.
Second: Get the guitar in tune and then physically stretch each individual string by grabbing it from underneath and stretching it upward the whole length of the string. Once all strings have been pre-stretched lock the nut and tune the guitar. The guitar will need to be tuned to pitch and retuned as you make adjustments. This may require unlocking the nut to re-tune.
Third: Make sure that the string locks on the bridge are tight enough or your strings can slip from this point.
I usually run my strings through the tuning pegs until the ball end stops them - then I pull the string over the bridge and clip the length about 1/2 to 3/4 inch past the bridge where the string would enter from the top - insert this end into the bridge and then tighten the lock.
Usually this, after stretching -tuning and re-stretching, will make my guitar invulnerable to tuning destabilization.
Good luck.