It is not permissible to do this in the month of Ramadan without necessity, so you have to travel a legal distance (22 kilometers) from the boundaries of your city that morning, then break your fast there and return to your city, and then perform masturbation.
Then know that it is not permissible for you to masturbate with your hand, rather your wife must do it with her hand.