Not so sure why I cannot do this in Maya 2018, so here is the script for you (and for me).
Demo: https://youtu.be/Kb9Y91Vi2QA
Cheers,
Truong
a Maya script to select joint local rotation axis
For personal use and one commercial project (up to 2,000 sales or 20,000 views).
One copy to be used by a single user.
One installation by a single user.