I don’t think you can. Unless you Mount the phone before you start.
To do this you have to put the phone in a horizontal location on the parallel to centre line of the boat.
In the phone App see Settings;Roll,Pitch,Yaw
From another Raceqs post on LinkedIn
1) Wind direction. The app uses a rule based algorithm which assesses the likely wind direction based on the tacking / gybing angles and course shifts on close hauled POS (likely headers and footers). Estimated margin of error is about 3 – 5 degrees in the single boat mode and 1 degree with 5 or more boats are on the race course. This method of calculating VMG although not exact, incorporates the current impact and is more accurate than VMG toward wind without adjustment for the current.