Need of an advice related to transformations

I am starting with glsl and OpenGL 3.30 and so far I have implemented rotation, traslation and perspective (like in OpenGL 2.0).

My question is this. Should I calculate the vertex transformation out of the vertex shader or in the vertex shader? (give the shader rotation, traslation and projection).

Thanks in advice.

How frequently do You change the data?
If your data is static (transformation remains the same most of the time) then do it once out of shader,
or in shader and store result somewhere for later use (transform-feedback).

If your data has differrent transformation in each frame do it in vertex shader
(that’s what vertex shaders are supposed to do)

If you move your camera, transformation will change anyway from frame to frame so you should do it in your vertex shader.
If I’m wrong and even the camera is at fixed position all the time then you can do it as a preprocessing.

Thanks for your fast reply, they helped a lot