The width of your shoulders is determined by the lateral delts, or the sides of your shoulders. You train this with (dumbbell) lateral raises. You can tackle them even better with the so-called lean-in variant.
The advantage of lean-in lateral raises compared to the standard version (upright) is that you create high muscle tension in the stretched position, or the bottom part of the movement. With regular lateral raises, the muscle tension there is literally zero. Coach Menno Henselmans therefore recommends the lean-in lateral raise for anyone who wants wider shoulders.
And what about dumbbell lean-away lateral raises? According to Henselmans, this increases freedom of movement in an irrelevant direction and causes shoulder pain in some people. You can benefit from a greater range of motion when you do cable lean-away lateral raises.