problem in adding rotation to a moving object

I am moving an object through a script using transform but when I rotate the object it still keeps moving according to its global axis instead of moving according to the local axis .how can i fix the problem

when you use the transform.Rotate function, add Space.Self as a parameter after your Vector3

example :

Vector3 v = new Vector3 (1f, 1f, 1f);
transform.Rotate (v, Space.Self);

for more info :