Sometimes you just have to be naturally flexible, I did it on the ice the first time I tried without even practicing

but it might be because I did a lot of other sport before I started hockey, including kickboxing where we always did a ton of stretching.
The sit-and-reach test is great for measurement of your flexibility
Here's an old picture of a 17 year old me in full splits
