In Solidworks, sketches and features on the front plane correspond to the Z vertical axis. Try sketching and extruding a circle on the front plane and then exporting it as an .stl and you will see that Z is the vertical axis. My guess is that you are starting your solidworks sketches on the top plan...