How should I add a transform.position on a List?

I need to do a list of positions of an object as time passes, so I’m having an error whenever I try to add it to a list variable. I’m trying to add it on a list and later use something like Debug to display the list on the console.

Here is the code snippet I’m using:

public List<Transform> 	listOfPosition = new List<Transform>();
void Update (){
	if(Input.anyKey)
	{
		Debug.Log("A key or mouse click has been detected");
		listOfPosition.Add(transform.position.x);
		listOfPosition.Add(transform.position.y);
}

The error that I’ve been getting is :-

1) The best overloaded method match for 'System.Collections.Generic.List<UnityEngine.Transform>.Add(UnityEngine.Transform)' has some invalid arguments

2) Argument '#1' cannot convert 'float' expression to type 'UnityEngine.Transform'

I have gone through the code multiple times and have referred to a number of sources but I still can’t manage to see a workaround.

transform.position is a Vector3

 public List<Vector3> listOfPosition = new List<Vector3>();
 //.... 
 listOfPosition.Add(transform.position);