A creature can't just change its size category
The animated objects are considered creatures, we learn that because the spell refers to them as constructs, which is a creature type and also because they get values for the 6 ability scores assigned to them. Each creature has a size it is categorized in. In the case of this spell, those sizes are assigned when the spell is cast. A size category is generally used to determine a creature's hit dice (unless it's a player character) as well as how much space it typically takes up on a battlefield.
Now your question is essentially: Does a creature's size category change when it expands itself? Imagine the following scenario: You enter a shop, but the human shopkeep (size medium) is ducking down behind the counter trying to hide from you. Does this make him a a small creature, because his body is half as tall while ducking and then make him revert to being medium again when he decides to stand up again? No, the shop keep is always considered a medium creature, it doesn't matter if he stands, sits, lies on the ground or holds his hands above his head.
The same is true for your unfolding animated object. If it can expand to become of size large, that can only be because it was considered a large creature in the first place, i.e. when the spell was cast and this tells us it is just right now in a position that makes it take up less space then it would in its unfolded form, just like the ducking shop keep. Ask yourself: What is this object's "normal" form? If it is being your large flying mount, then it is a large creature, that you can just also fold together to put it in your pocket. Even if it was in that folded form when the spell was cast on it.
The folded object is squeezing
There is a rule for creatures that don't become a smaller size, but take up less space, it's called squeezing. Any creature can move through a space that is one size smaller than it. This decreases the amount of space the creature takes up on a battle field (except for medium creatures) and makes it suffer some negative effects such as each step costing it more of its movement.
As stated a creature can typically only squeeze into a size that is 1 size smaller. Your DM might however rule that your animated object is so flexible it can squeeze from Large all the way down to Small.