So, I'm far from an expert, but I think you might want to look into perverse sheaves.
I've been reading up on them lately, they're objects in the derived category of sheaves on a space, and I have seen a lot of stuff about Lefschetz theorems and their derived analogues pop up. Pramod Achar recently published a great book on the topic.
The "perversity" one chooses with which to defined perverse sheaves is related to tranversality, and allowing it to fail.