During the process of porting my tools to the new version of Blender 2.8 I couldn’t find a tool that would easily allow me to align the origin pivot rotation to a sub-object, or object selection, and I decided to write and share the tool below.
undoz_tools_blender_2.8_v1.01..zip - Note: Blender 2.8 + required
Unzip the archive to %appdata%\Blender Foundation\Blender\2.80\scripts\addons (Undoz_Tools folder should be present in addons)
Start Blender, open Edit > Preferences, search for Undoz in the Add-ons section and enable the script
Edit mode: Make a selection
Object mode: Select two objects (The Active/Last selected is the source for the pivot/origin orientation)
Press F3 to and search for the command called: Align Origin Pivot To Selection