How can I change transform.rotation into a float variable?

I’m making an action game, and want to store the rotation of an object as a variable to make it move via sin and cos. It says that you can’t put transform.rotation as a float.

Help?

I found an answer. I instead have a different problem. When I use my script, it says:

Cannot implicitly convert type ‘void’ to ‘UnityEngine.Vector3’.

How do I solve this? Here is the line of code that it says is buggy:

transform.position = transform.Translate( transform.forward * speed * Time.deltaTime );