According to the solution, we assume that there is no current coming from the loop which is defined by the capacitor and Vout. Why is that assumption correct? I mean, if we connect an external circuit between the Vout pins, there must be a current flowing there, so the calculated trasfer function fails to describe the Vout-Vin relationship correctly.
It's a convention. You can get very close to that in practice by feeding Vout into a high impedance amplifier (like a FET).
To model this network feeding another circuit, say, an amp with 10K input impedance, just connect R2=10K across the Vout terminals and model that. The new transfer function will be correct for the new load.
Another common convention is used in radio frequency circuits : impedance matching to 50 ohm circuits is very common, where you can assume the source impedance driving Vin, and the load impedance on Vout, are both precisely 50 ohms (or 75 ohms in television studios, or 600 ohms on telephone lines).
But this is an introductory exercise so you don't need to deal with that complexity yet. Assume infinite load impedance.