Position of the LIDAR inside a box
Ultimately, it's about maths, not Electrical Engineering.

So far as the LIDAR is concerned, it is at the centre of the universe, and it defines a zero degree axis.  All the coordinates it returns are relative to that centre and that axis.

It probably returns polar coordinates (r, θ), where r is range and θ is angle relative to the axis.  It should be a simple bit of trig if you would prefer them converted to (x, y).

Your task is to perform a rotation and translation on those coordinates to align them with what you have chosen to be the centre of the universe - the box.  The tricky bit is working out what that translation and rotation is.

If you are in a box, you should find that the points neatly fall into straight lines.  You will need to work out some way to determine which points are in which lines.  Perhaps use a Hough transform.  Or just pick a group of sequential points from the LIDAR and determine whether they are close enough to forming a straight line.

Once you know where the lines are, relative to the LIDAR, you can work out the rotation to turn the lines to where you want them, then the translation to move everything relative to the centre of the box.

Be aware that if the box is a simple rectangle or square, then there is always some ambiguity.  If some sneaky person turns the LIDAR off for a moment, rotates the whole thing 180° and turns it on again, you will have no way to know.