The hip complex consists of multiple components: the hip joint, pelvis, and lumbar spine. The key is to coordinate the pelvis and spine to provide optimal stability in order to get non-compensatory rotation at the hip joint in both internal and external rotated positions. But it's something that must be practiced.
For getting the most out of your hip rotation, especially during the squat, hip hinge, and lunge, you must first have a stable pillar unit. From there, you'll be able to rotate your hips in other movements.
Here are a few drills for neurologically locked hips that you can use in a pre-training routine for both internal and external rotation limitations:
Hip IR/ER Corrective Sequence of Drills
Though nearly every joint and region of the body has some rotational abilities, both the hip and shoulder regions were designed to display wide ranges of mobility. This is the case with ball and socket based joints. Address these first, and chances are you'll never have to correct misplaced rotation elsewhere.