What is the peak voltage output of your generator?
Note, that it is connected to ADC with protection diodes. So, positive voltage will go through D2, R3, R5 and if at this point it is higher than Vcc it will open D4 and jump to +3.3V rail.
Sure, you have quite a lot of resistance here, but it does not really matter. High enough spikes from generator will burn your STM32 in no time.
What you really need is zener somewhere (maybe in parallel with R4) to limit voltage input from generator. Also I'd recommend checking the rest of the circuit. The generator output (either positive or negative) might have some other path to jump to the rails.
Also, to measure variable as it is voltage output from the generator you need a low-pass filter. Coincidentally, a capacitor in the circuit before protection diodes could have helped save your STM32 too.
The heating of the LDO is not related to the problem, it is only because of lack of heatsink and huge voltage drop from 12V. I'd recommend using thermal resistance from datasheet to calculate appropriate heatsink, instead of adding second LDO.