Most controls allow for coordinate system rotation. G68 is a common G-code to execute this. G69 cancels the G68. To find the amount of rotation, you could edge find two points along the Y axis with a known distance between in Y and obtain the X locations for those two points. Once you have the slope of the line, the angle can be known. You would also want two points along the X axis to find the intersection to have a known corner location and point of rotation. That corner becomes your part zero and point of rotation and reference position of the other features.