Rotate Blender's 3D cursor to align its axes with selected edges. Active edge takes precedence when selected edges are not at a right angle to each other.
In edit mode, select two edges and choose command Align 3D Cursor to Edges
from the command palette. To then work in the coordinate system of the aligned 3D cursor, set "Transform Orientation" to "Cursor".