The purple hatched area around the heatsink looks like its step model envelope, not its keepout. That's just how Altium renders step models in 2D (you can change the display mode in the view configuration, but your only options are a hatched rectangle, an outline rectangle, or no rectangle at all).
Generally, if you've got step models defined for all of your components, you'd use clearance rules based on these, but if you don't have step models, then you have to define your clearance controls some other way, which probably involves drawing your keepouts in all of your component libraries if you want to do anything non-rectangular.
Note that even with step files for both the heatsink and the transistor you won't be allowed to have them touch on the board by default. You'll probably want to create a specific clearance rule that allows those two specific parts to touch (you can set component clearances to negative distances to allow components to overlap slightly, if you can't get the alignment completely perfect).