What is the general formula to calculate the peak to peak ripple voltage and Vdc average of the voltage at the input of the 7805 voltage regulator in a circuit like this?
The general formula should really be independent of what the load is. A 7805 with a fixed load resistance R is equivalent to a stand-alone constant current source 5V/R.
So, first we simplify the circuit we want to analyze:

simulate this circuit – Schematic created using CircuitLab
And now we attach this load to the rectifier:

simulate this circuit
With the source set to 9VAC RMS, rhe ripple on the smoothing capacitor looks as follows:

The ripple amplitude is ≈3.2Vpp.
To make the derivation more elementary, we further assume that the current pulses that charge the capacitors are infinitely short.
Thus, we have smoothing capacitor being discharged by a constant current from some peak rectified voltage, at a frequency of 50Hz. Due to full rectification, every 1/100th of a second, the capacitor gets recharged infinitely quickly and the discharge repeats.
Thus, all we really need to know is how low the capacitor discharges from the peak voltage:
$$\begin{aligned}
C &= \frac{\Delta Q}{\Delta V} \\
\Delta Q &= I_{discharge} \cdot T_{discharge} \\
& \text{thus} \\
\Delta V &= \frac{\Delta Q}{C} = \frac{I_{discharge} \cdot T_{discharge}}{C},
\end{aligned}$$
where T is the rectifier pulse period - 1/2 of the mains period.
So, for our particular case of 57μF, 25mA load, and 10ms period (100Hz) we'd have
$$
\Delta V = \frac {25{\rm\,mA} \cdot 10{\rm\,ms}} {57{\,\mu\rm F}}
\approx 4.4{\rm\,V}.
$$
This estimate is a bit high. Looking at the formula, we know that the load current and the capacitance are known exactly, so that's not the problem. It seems that the time is too long. We'd get \$\Delta V\approx 3.2{\rm\,V}\$ for \$T'=7.3{\rm\,ms}\$.
So, how to find this time? Can we see it anywhere in the ripple graph? Let's see:

We found it: that's the time the capacitor is discharging. The remaining \$10{\rm\,ms}-7.3{\rm\,ms}=2.7{\rm\,ms}\$, the voltage is "riding up" the sine wave as the capacitor recharges.
We'd now want to find this charging period τ. From the graph we note that \$\Delta V=\frac{I(T-\tau)}{C}\$, and we can derive
$$\begin{aligned}
V_{pk} \sin \left( \frac{\pi}{2}-\pi\frac{\tau}{T} \right) &= V_{pk} - \Delta V \\
\cos \left (\pi\frac{\tau}{T} \right) &= 1 - \frac{\Delta V}{V_{pk}} \\
\cos \left (\pi\frac{\tau}{T} \right) &= 1 - \frac{I}{V_{pk}\,C}(T-\tau) = 1 - \frac{I\,T}{V_{pk}\,C} \left( 1-\frac{\tau}{T} \right)
\end{aligned}$$
To simplify this expression, we make two substitutions:
$$\begin{aligned}
\frac{\alpha}{\pi} &= \frac{\tau}{T} \\
\beta &= \frac{I\,T}{V_{pk}\,C} \\
\end{aligned},$$
and then
$$\begin{aligned}
\cos\left( \pi\frac{\alpha}{\pi} \right) &= 1 - \beta\left(1 - \frac{\alpha}{\pi} \right) \\
\cos(\alpha) - \alpha \frac{\beta}{\pi} - 1 + \beta &= 0. \\
\end{aligned}$$
Now we can expand the left side into a power series:
$$
\beta - \frac{\beta}{\pi} \alpha - \frac{1}{2} \alpha^2 + O[\alpha]^3 = 0,
$$
and solve:
$$
\alpha \approx \frac{1}{\pi}\left(
\sqrt{\beta}\sqrt{\beta+2\pi^2} - \beta
\right).
$$
For those of you wanting to get α without using square roots, here's a 2nd order Padé approximation:
$$
\alpha \approx \frac{0.135452 \beta ^2+0.42255 \beta +0.0753487}{0.0450834 \beta
^2+0.304995 \beta +0.209677}.
$$
Now we can back-substitute \$\alpha\$:
$$
\tau = \frac{T}{\pi^2}\left(
\sqrt{\beta}\sqrt{\beta+2\pi^2} - \beta
\right).
$$
Let's get numerical results:
$$
\beta = \frac{I\,T}{V_{pk}\,C} =
\frac{25{\rm\,mA} \cdot 10{\rm\,ms}} {12.2{\rm\,V} \cdot 57{\mu\,\rm F}} = 0.3916.
$$
Then
$$\begin{aligned}
\tau &= \frac{10{\rm\,ms}}{\pi^2} \left(
\sqrt{0.3916}\sqrt{0.3916+2\pi^2} - 0.3916
\right) = 2.4{\rm\,ms} \\
T' &= T - \tau = 10{\rm\,ms}-2.4{\rm\,ms} = 7.6{\rm\,ms} \\
\Delta V &= \frac{I \, T'}{C} = \frac{25{\rm\,mA} 7.6{\rm\,ms}}{57{\rm\,\mu F}} = 3.3{\rm\,V}.
\end{aligned}$$
The complete formula for ripple voltage then is:
$$
\boxed{\begin{aligned}
V_{pk} &= \sqrt{2} \, V_{RMS} - 1.4{\rm\,V}, \\
\beta &= \frac{I\,T}{V_{pk}\,C}, \\
\tau &\approx \frac{T}{\pi^2}\left(
\sqrt{\beta}\sqrt{\beta+2\pi^2} - \beta
\right), \\
\Delta V &\approx \frac{I \, (T-\tau)}{C}.
\end{aligned}}
$$
Above, \$V_{RMS}\$ is the RMS AC voltage being fed to the rectifier, we assume 1.4V drop across full bridge under peak load, \$I\$ is the constant load current, \$T\$ is the half-period of the AC voltage (e.g. 10ms for 50Hz mains).
The average DC voltage is about
$$
V_{DC,avg} = V_{pk} - \frac{1}{2} \Delta V.
$$
These formulas are approximate - with one useful significant digit, say ±10%. For better results, use SPICE with an accurate model of real components. Pay attention to the source impedance seen from the transformer's secondary, the ESR of the capacitors, behavior of diodes under pulse loading, etc.
The formulas work assuming a simplified model, and use series expansion - that's because the circuit, although simple, is highly nonlinear and no closed-form exact solutions exist and there's no point to them anyway. The model is too simple to start with. For a more complex model that uses differential equations and includes capacitor ESR and transformer Zsource, it's possible to get rather unwieldy analytical approximations using the Fourier transform. An interesting but rather practically useless exercise.