Of the three dimensions you are thinking about (left-right, up-down, fore-aft) only two are at all relevant except in macro photography. For-and-aft is not one of the axes of stabilization since it generally requires a lot of camera movement in the fore-and-aft direction to affect focus, either by moving the subject out of the depth of field that could be described as "critically sharp", or by changing the magnification enough to have the image begin to spill into pixels it wouldn't otherwise have hit. Conversely, it takes a very tiny amount of camera motion in the up-and-down or left-and-right directions to visibly blur images of things that aren't effectively at infinity.
That leaves three axes that do affect sharpness with relatively minor camera movements: pitch (pointing the camera upwards or downwards), yaw (pointing the camera to the left or right), and roll (rotating the camera round the lens axis). All three will result in displacing the image on the sensor, causing motion blur. In addition, pitch and yaw will change the plane of focus and will cause some keystone distortion (like tilting a tilt/shift lens).
The three axes of rotation (roll, pitch, and yaw) will do the most damage to the image with the least camera movement. The up-down and left-right shift, which are also necessary to correct pitch and yaw displacement (though they do nothing for keystoning or focal plane changes) just sort of come along for "free" (computationally speaking).