The 7812 voltage regulator requires an input voltage which is several volts higher than 12 in order to function properly (see data sheet). The difference between that minimum voltage and 12V is called "dropout". The 7812 is a fairly high dropout regulator. As long as the input voltage is sufficient (the minimum dropout is met), the regulator can provide a smooth DC, in which the input ripple from the bridge rectifier is reduced by around 80 dB (check the exact ripple reduction decibel figure in the data sheet).
If you measure the voltage on the capacitor you will see that it charges to a higher voltage than 12. The secondary winding of the transformer is 12V, but that's a nominal RMS AC voltage. The peak voltage is actually higher, and the peak voltage is what charges the capacitor. If the secondary windings operate at 12V RMS, then the capacitor will charge to a peak of about 17V. Thus, at the peak, there is 5V of dropout.
On each cycle, the capacitor charges to the peak voltage. Then, it discharges as the regulator draws current from it. The capacitor must be large enough that when the regulator draws current from it between the charge cycles, the voltage will not drop below the minimum voltage specified for that regulator.
This must be ensured under the worst-case load for the regulator when it draws the most current.
Beyond satisfying the worst case current draw, if you further increase the capacitor to a larger value, the only benefit it provides is that it reduces the peak-to-peak ripple. This is a minor benefit, since the regulator is actively reducing that ripple by 80 to 90 decibels already. If the ripple is 0.5V peak to peak at the input of the regulator, and is cut 80 dB, it becomes 50 \$\mu\$V peak to peak at the output. If you reduce the input to 0.3V peak to peak with a larger capacitor, the output ripple goes from 50 \$\mu\$V to 30 \$\mu\$V. Both these values are small and possibly insignificant to the circuit.
If the circuit needs less ripple, by far a better way to get it is to use a better regulator with more decibels of ripple rejection, rather than making the capacitor larger.
A regulator that improves rejection from 85 dB to 110 dB will make the same difference as a really huge and impractical capacitor substitution.
A capacitor which is too large stresses the transformer rectifier diodes when power is applied, because the bigger the capacitor, the bigger and more sustained is the inrush current.