There is a need for using the right terminology here. In your circuit, you have a RCD clamping network or RCD clamp also sometimes found as peak clamp in the literature. The other \$RC\$ network is a damping network or snubber not to be mixed with the RCD snubber intended to delay the voltage waveform at the switch opening and reduce turn-off losses.
The RCD clamp operating principle is equivalent to building a low-impedance dc voltage as represented below:

The energy stored in the leakage inductance with a bit of magnetizing current contribution is absorbed by the resistance while the capacitor is scaled to limit the acceptable ripple. If the voltage on the \$RCD\$ clamp is equal to \$V_{clp}\$ then the voltage on the drain at the switch opening is equal to \$V_{HV}+V_{clp}+V_{os}\$ in which \$V_{os}\$ relates to the voltage overshoot brought by the diode forward transit time.
The calculation of this \$RCD\$ clamp network is not that complicated but requires the determination of several parameters such as the maximum peak current in the converter in the worst-case situation. Usually, this is with the maximum input voltage from the specifications and a true short circuit at the output terminals (at the board level). Under these conditions, the voltage on the MOSFET shall never exceed its \$BV_{DSS}\$ derated by a 10-20% ratio. For instance, should you choose a 600-V MOSFET and apply a 15% derating factor, the maximum drain voltage shall never exceed 600 x 0.85 = 510 V. I detailed all the calculations linked to the determination of this peak clamp in an APEC seminar that I taught in 2011: The Dark Side of the Flyback Converter.
Now the damper. This guy is here to dissipate power, that it the way you damp a system. However, you want ac power and not dc power, hence the need to cut the dc component via the series capacitor. Below is the way to size this damper and it uses a simple method proposed by Dr. Ridley many years ago:

In the vast majority of designs I have seen, a snubber takes place across the secondary-side diode for reducing the ringing and its radiating contribution. I haven't seen many across the primary side of the transformer.