Rotate around an objects local position not global position with Transform.RotateAround

I’ve basically got a sphere rotating on the y axis around an empty game object at 0,0,0 using:

if (Input.GetAxis(“Horizontal”) && Input.GetKey (KeyCode.D)) // if ‘D’ is pressed.
{
transform.RotateAround (gameObject.position, Vector3(0,0,1), speedToRotate * Time.deltaTime); //rotate around gameObject, on y axis at speedToRotate = 5
}

When I rotate the gameObject the sphere continues to rotate around the world y axis not the gameObject’s axis. Is there a way of making it rotate around the local gameObject’s y axis rather than the world y axis?

var verticalaxis: Vector3;

if (Input.GetAxis("Horizontal") && Input.GetKey (KeyCode.D))
 // if 'D' is pressed.
 {

 verticalaxis = transform.TransformDirection(Vector3.up);

 transform.RotateAround (gameObject.position, verticalaxis, speedToRotate * Time.deltaTime); 
//rotate around gameObject, on y axis at 

speedToRotate = 5

 }

You just need to find the local direction of the object by using transform direction. Once this value is found, it can be inputted into the axis part of the function.