Calculate camera orientation by using the up-vector pointing from planet center to player (gravity direction).
This up vector is the only thing you can trust in,
e.g. an additional tangent towards south pole (or any other fixed point on the planet surface) will flip as soon as you move over that point.
But the up vector alone is enough - looking left / right becomes rotating about up vector, Looking up down becomes rotating about cross(upVector, characterFrontDir).Unit()
So after that you have a matrix or quaternion storing camera orientation in worldspace, and you need to get 3 Euler angles from that.
Getting Euler angles directly from player input would be just pain - don't try to do so - waste of time.
Make sure your engine really does not support any other camera option than Euler angles (pan, tilt, roll, - pitch, yaw, roll, - rotate x,y,z... mathematically that's all just Euler angles).
To convert from matrix / quaternion to Euler you also have to know (but mostly have to guess) the order of the 3 rotations defined by those 3 angles.
This can become a frustrating source of trial and error.
If your engine can take any kind of projection matrix (And it really should - otherwise, what engine do you talk about?), use this instead.