There is a formula but I forget how it goes.
Here's a crude method using simple calculations...
Assuming your supply is a conventional full-wave diode bridge, and your mains is 60 Hz...
The capacitor receives a burst of current 120 times a second.
For 1/120 of a second the capacitor powers a 1.5A load at 12V.
The load calculates as 8 ohms.
Suppose you permit 5 percent ripple voltage. Then the capacitor discharges by .6V in 1/120 sec.
Now we calculate the RC time constant. This works out to the time it takes a capacitor to lose 63 percent of its initial charge through a resistor.
If it can discharge by 5 percent in 1/120 second...
Then this calculates to 63 percent in 12.6 /120 of a second, or .105 sec. (For simplicity I am regarding the discharge graph as a straight line.)
The time constant can be .105 second. The time constant is defined as R x C.
So divide by 8 ohms. The capacitor value should be .013 F, or 13000 uF, if we allow 5 percent ripple.
This sounds like a big capacitor. I seem to remember my supply has a 4700 uF. Its transformer is 12V and the ripple is obvious when it is putting out a couple amps.