You can use pivot alignment to move a local coordinate system to a defined kinematic condition.
Context:
In the following example, the initial position is as follows:
Click Transform > Pivot Transform Mode .
This enables pivot transformation mode.
Move the local coordinate system to the kinematic link location using a command such as Set Pivot On Line/Axis .
Use Align Pivots With Given Pivot to align the child and parent coordinate systems.
Note: If it is not possible to align both coordinate systems, add a rigid parent.