Let's take a look on the diagram below.

On the left, you see the aforementioned transformer. In this case, the transformer's output voltage is 15V AC. This AC voltage is rectified by bridge rectifier G1. The rectified voltage is smoothed by capacitor C1. Without C1, the output would be just a rectified sine wave signal. If you would power your walkman with this voltage, you would hear a terrible 100Hz humming. The result of a computer simulation below shows what C1 does.

In this picture you see two signals: a rectified sine wave (the
situation without C1), and the situation with C1. At t=0, C1 is
discharged, so V_{C1}=0V. G1 will then charge C1 until
t=T1. The top value of the rectified signal is 15V∙√2 - 2∙0.6V = 20V.
After t=T1 C1 will be discharged by the load until t=T2. Then, everything
will start all over again.

V_{r} is called the ripple voltage. Especially
in audio equipment it should be as small as possible, because voltage
ripple in the power lines means voltage ripple in the sound signals! You
can reduce the ripple voltage by using larger capacitors. You can calaculate the value of the
capacitor, but you can also use the rule of thumb: 2000...5000uF
(2...5mF) per ampere load current.

You might think that the maximum voltage across C1 will be 20V. But this is only true if the secondary voltage of the transformer is 15V. Unfortunately, this voltage depends on the load. The open line voltage may be 18V or even more! Take this into consideration when buying a capacitor for C1, since all capacitors have a maximum voltage they can sustain.

The load-dependency of the output voltage of the transformer also
explains the presence of zener diode
D1. Without D1 the output voltage would depend on the load, and that is
something we don't want. Thanks to D1, the voltage across P1 and R2 is
always 12V. So the voltage at the base of T1 only depends on the position
of P1. With P1 turned to the maximum position,
V_{B}=12V. The output voltage
V_{E} will be 12V-0.6V=11.4V. With P1 turned all the
way down, V_{B}=V_{R2}.
V_{E}=V_{R2}-0.6V. Of course we
want V_{E} to be 0V, so
V_{R2}=0.6V. We can now calculate R2:
R2:P1=V_{R2}:V_{P1}=0.6:11.4, so
R2=(0.6/11.4)∙10k = 526Ω. 470Ω is a good choise.

If we want 5mA current flow in D1,
I_{R1}=5mA+V_{D1}/(P1+R2)=5mA+12/10470=6.15mA.
R1=(V_{top}-V_{D1})/I_{R1}=(20-12)/6.15mA=1.3k.
1.2k is a good choise. This calculation assumes that T1's base current is
very small. And it should be, because a large current will cause a high
voltage drop across the top part of P1. This will reduce the base voltage
and this the output voltage. And since the base current depends on the
output current, the output voltage would depend on the output current. And
we don't want that. You may need to replace T1 with a darlington.

Zener diode D1 has another advantage: a small ripple voltage across
C1 does not appear on the output terminals. Even if
V_{r}=5V, the voltage across C1 will never drop below
15V and V_{D1} remains 12V. This means that you can
create a ripple free power supply without coffee table size capacitors!
However, don't make C1 too small. Charging C1 causes a high current flow
in the transformer. If C1 is small, charging takes a relatively long time
and might overheat the transformer.

When V_{C1}=15V,
I_{R1}=(15-12)/1200 = 2.5mA. This leaves 2.5-1.15 =
1.35mA for D1. And this might not be enough for D1 to operate properly. If
we want I_{D1} to be 5mA (and thus
I_{R1} 6.15mA), then R1=(15-12)/6.15m = 488Ω. So R1
should be replaced with a 470Ω resistor. Let's now calculate the current
when V_{C1} reaches its top value (20V).
I_{R1}=(20-12)/470 = 17mA. So
I_{D1}=17-1.15 = 15.35mA.
P_{D1}=12∙17m=0.2W. So a 0.4W zener will
survive.

Please keep in mind that the top value is only 20V when the
transformer voltage is 15V. We already saw that this voltage depends on
the load current, and that the open line voltage can be 18V or more.
Always consider the worst-case scenario. Assume we measure an 18V open
line voltage. Add 10% to this, just to be safe. So we assume a top value
of 20V∙√2 - 2∙0.6V = 27V. I_{R1}=(27-12)/470 = 32mA.
P_{R1}=(27-12)∙32m = 0.48W. R1 must therefore be a 1W
resistor. I_{D1}=32-1.15 = 30.85mA.
P_{D1}=12∙30.85m=0.37W. Although this is just below
0.4, D1 should better be replaced with a higher wattage zener.

Another method is enlarging C1, making the ripple voltage smaller.
Assume that the ripple voltage has been reduced to 2V.
V_{C1,min} is now 20-2=18V. R1=(18-12)/6.15m = 976Ω.
We'll take an 820Ω resistor. When V_{C1}=27V,
I_{R1}=(27-12)/820 = 18.3mA.
P_{R1}=(27-12)∙18.3m = 0.27W. An 1/3 of 1/2W resistor
will now be sufficient. I_{D1}=18.3-1.15 = 17.15mA.
P_{D1}=12∙17.15m=0.21W. A 0.4W zener can handle this
very easily.