Three important physical attributes that lead to more power in the golf swing are strong gluteal muscles, core stability and ankle mobility. Strong glutes should be obvious. They are prime movers in the golf swing and control the action of the pelvis. You also need strong muscles around the mid-section of your body to stabilize it as you swing a club, especially at faster speeds. Without it, you wouldn't be able to keep your balance and hitting the ball with the center of the clubface would be a real challenge. The third attribute might have surprised you, but it's just as important. Ankle mobility matters particularly in transferring weight from your back foot near the top of the backswing into the front foot as you swing down. If you think of the footwork of players such as Tony Finau, Bubba Watson and Justin Thomas—very big hitters—you might have an easier time understanding why functional movement in the ankles is a crucial part of power generation. They have active feet and extremely mobile ankles. Most long-ball hitters leverage the ground to store up power and then spring upward through impact. A good example of this was Tiger Woods' swing while working with Sean Foley.
So what exercise can you do in the gym to improve function in your power-generating muscles? Squats. But not just any squats. In fact, the majority of people should avoid doing most types of squats—especially traditional barbell squatting—as it is one of the easiest ways to injure your lower back. Instead, try goblet squats. This exercise is great because it's amazingly self-regulating, both in terms of form and safety. If there are issues with core stability or ankle mobility, you'll know it the minute you try a goblet squat. If your trunk lurches forward or you can't drop your butt down until your elbows are about knee height—or lower—then you'll know you need to spend some time on core stability exercises and ankle mobility exercises. Continuing to practice the goblet squat will help, but you need some extra work on the exercises provided in the links, too. As far as how much weight to use, I recommend starting with a lighter dumbbell or kettlebell and then progressing to heavier weight as your form and range of motion improve. If you can't easily pick up the weight with one arm, start with something lighter.
To watch me demonstrate a goblet squat, click on the video below. Add these to your workout and you'll be priming your body for better power generation when you play.