For the GPS itself the orientation is not important. For the Magnetometer itself the orientation must be known but it can be set by parmeters of the FC
The Magnetometer chip is the small device in the lower left corner of your left picture.
Based on that picture the positive X-Axis is downwards and the positive Y-Axis is to the right.
Point the connector towards the rear of the craft. When a compass calibration is performed it will determine the orientation and set it automatically from the Auto rotation parameter which is enabled by default.