What does these heatsinks do?
The transistor collector metal exposed at the back, the metal heatsink, and the insulation between them means you built a capacitor. As the heatsink is isolated it is very high impedance node so even a small amount of capacitance between collector and heatsink will couple the collector waveform to heatsink. An oscilloscope is also quite high impedance measurement tool, especially when used with a 10x probe, so it will only slightly add capacitive and resistive load to the heatsink. When you touch the heatsink you also add capacitive and perhaps resistive load if you touch ground so the waveform amplitude is less when touching the heatsink.