Find coordinate location of game objects in scene?

I have a player who moves by transform by 1.0 every step. Every movement I make leaves a clone of a cube behind each step leaving a trail of cubes. I need to find the location(in coordinates) of every cube that was instantiated. Either print the location as I move or at the end when I press a key

Best way is to keep a list of the objects as they’re created, and refer to the list as needed.

using System.Collections.Generic;

List<Transform> cubes;

cubes = new List<Transform>();

cubes.Add( myCube.transform );

foreach (Transform cube in cubes) {