The new creature has no memories
An object has no mind or mental stats that can retain memories. When the creature reverts to being an object, the object retains no memories, because there is nothing it could retain them with. The spell does not create a magical storage for the memories to persist - it would need to say so, if it could. The memories are lost when its transformation ends.
@Molot suggested in comments that the creature that is created by polymorph could have a soul, and that the soul would persist after the spell ended and could be a storage place for memories. The soul however would be part of the creature if it is created with the creature, so it also will end when the transformation ends, as objects have no soul.
You transform (...) the object into a creature (...). The spell lasts for the duration, or until the target drops to 0 hit points or dies. If you concentrate on this spell for the full duration, the spell lasts until it is dispelled.
If the object is turned into a creature again, this is a new creature, with a new, magical created mind that can start collecting new memories. Other than in the Creature to Creature case, which says the creature "retains its alignment and personality", there is no memory, alignment or personality to retain, because there was none. It is all created new.
All that said, the spell obviously does not adress this explicitly, so ask your DM. Maybe they think the object should remember, and that's how it will be at your table.