This seems like an obvious answer in the US where the top 10 are all very elite schools. In a small country where there is a big gap between one and ten, it might make sense to transfer.
I chose an okay state school instead of a top 10 school in the us for financial reasons, and it sometimes feels like it was the wrong decision.
In addition to the doors an elite school can open, the connections you make in college can be invaluable. A friend from high school went to Stanford, where he met the cofounder he started his business with. My dad’s connections from Princeton essentially saved my aunt’s life when she was diagnosed with a rare cancer.
If the connections you would make at the #1 school would be drastically better, I would say go for it. 2 years isn’t that big a deal