Simple: I would mount them along the axis that the lower mount is to the axle (perpendicular).
Less Simple: It's not entirely easy to say one way is better, because the rear axle is linked so as you hit a bump it moves in an arc so in that regard it's better to mount parallel to the axle so the shock can rotate and not have the bushing get torqued; however, when one tire moves at a different rate than the other side (flexing or hitting a hole with one tire) it causes the shock to try and rotate along the perpendicular axis to the axle.
With that in mind I would mount it perpendicular because I think you get more left/right motion than you do forward/back motion. And then of course as said, the lower mount is perpendicular so if you mount it the same way then you can relieve torquing the bushings in one axis of rotation instead of causing a torque regardless of the motion (if you mounted parallel since the two mounts would never work together). Ideally, and as fancier shocks do, the shock has spherical bearings on the top and bottom to allow for rotation in all axis versus a bushing which primarily allows motion around one axis.