So you have a forward, right, up value of your object, and you have a plane_normal that you want to rotate it around.
(those vectors need to be perpendicular to each other, you can use crossproducts if you know two of them. if you have three arbitrary points, forward=b-a;up=crossproduct(forward,c-a);right=crossproduct(forward,up); should get you three perpendicular vectors(remember to normalize as needed), but this does still impose a specific pair of points to give primary direction with the tertiary point only for roll angles, so you might want to use the midpoint between b and c instead of b if its not three points of a quad)
so if the plane's normal is to end up as your new 'up' vector, then the new forward vector is:
newforward = oldforward - dot(oldforward*plane_normal)*plane_normal;
(note: plane_normal points outwards, so you should read this as 'push into the plane by as much as the vector currently points away', meaning the resulting vector travels along the plane. you will have a singularity if oldforward points exactly towards the plane)
(also note: scaling that dot product by 2 will cause it to 'bounce' instead, with perfect energy conservation - values between 1 and 2 will bounce more normally)
you can do the same maths with the right vector too, but probably you'll find that term will just drop from your equations.
to turn that into angles, you can just use vectoangles(newforward,plane_normal), the plane_normal is of course your newup vector, and the newright vector isn't even relevant on account of it being known to be perpendicular and thus orientation can come from the forward vector with the up vector providing purely the roll angle.
note that none of this includes logic for the centre of gravity, so nothing will topple, so expect weirdness from steep slopes.
also note that the result of the maths is an exact value, there is no room for interpolation in its formula, which means you will likely want to somehow add your own smoothing if its a dynamic entity.