How to instantiate in local forward direction?

I don’t know why this doesn’t work. I can’t get the bullet to come out of the objects forward. It always goes forward in world space

using UnityEngine;
using System.Collections;

public class gun : MonoBehaviour {
    public GameObject bullet;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void FixedUpdate () {

       
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Instantiate(bullet, transform.localPosition,Quaternion.Euler(Vector3.forward));
        }
	}
}

Because Vector3 forward is just (0,0,1) which is world space. Quaternion.Euler(transform.forward) should work.