It kind of depends on how you do a spin class. I have found if it is a spin class taught by a spin only instructor, it crosses over a little. If you do longer spin classes taught by a cyclist who is working on a periodic plan with class with more of a bent toward regular training for outside cycling, it can really help a lot. Several years ago, I trained almost specifically indoors for the start of the mountain bike race series in January. We had a very snowy year and it was just not conducive to training outside. I live in northern Arizona at 7,000 feet

Long story short, I won my first race against desert rats from southern Arizona who had been training hard outside. It certainly can get you there if you find a good cycling instructor.