Offering him a new contract with a big minimum release clause is the only way to prevent this beforehand, it may work after the offer is accepted aswell
Worked =DMake the players loyalty maximum and make your club his favourite club,the offer him a lucrative contarct
If you are in transfer window, Go to FMRTE, transfer proposals, You can see the contract offered by CPU, put to minimum wages so that your player wont accept it,.
Or you can also edit the transfer money they have offered, put to some 200M so that transfer falls.