Wired - cannot work out which wires to isolate

Hello all. My transformer and existing chime seems to have fiendishly more complicated wiring than the Ring wired doorbell diagrams! I couldn’t work out which ones to connect together so tried just connecting the doorbell. Everything worked fine for about two months, (chime was bypassed) but now the chime gives one ding every 20 seconds or so accompanied by a choir of angels from the doorbell! I’ve had to switch off the power to the downstairs lighting circuit until I get it sorted!

Can anyone advise from the photos which wires I should connect together? Thanks!

Here is the transformer