Realigning the Axis to Geometry
Create a new transform-orientation based on sub-object (component) geometry, like edges. The Z-axis will point in the direction of the cross-product of any two edges selected.

If you are not familiar with that term, the cross product is the vector that is normal to 2 other vectors. Keep the following in mind as examples:

The Z-axis is the cross-product of the X and Y-axes;

The X-axis is the cross-product of the Y and Z-axes;

the Y-axis is the cross-product of the X and Z-axes;

(You can also look up "cross-product" or "Right Hand Rule" for a way to visualize general cross-product vectors. It is not necessary to know the math to visualize a cross-product)

The cross-product of 2 vectors is perpendicular (in 3d we say "orthogonal" or "normal") to the plane the 2 vectors are in:



Say I wanted to create this fan shape so that it was oriented to the curvature of the bookshelf. The shape is a quarter-circle in the plane that I could have made a few ways, but I did it by rotating duplicates of edge components about this corner (the cursor is placed there and transformations are oriented about the cursor). To do that, I first had to get my transform orientation right. I did that by selecting the 2 orthogonal corner edges shown here, then creating a new transform orientation from that, as shown below:



This is the result:



Notice that the transform orientation is still usable even after returning to object-mode:



Now I was able to rotate edge duplicates about the corner, in a plane that is normal to the bookcase. Rotations are done about the new Z-axis in this orientation.  Big-picture: