I don’t mine, and I haven’t been fighting much NPC’s lately either, but my understanding is that you have two different kind of Triglavian attackers.
First is, your system is in range of a Triglavian invasion. IIRC that means you are within 2 jumps of the Triglavian invasion site. In this case you will get various types of Raznaborgs and Trigs attacking you at different points in the system (gates, belts etc.) You should get a visual warning that you’re in range of a Triglavian invasion site, and in that case the logical thing to do would be to move away into a non-invasion system.
The second type is “Triglavian Recon Scouts”, which are smaller groups of (I think) 3 Triglavians that can be encountered anywhere. You shouldn’t be running into them as frequently but they are still dangerous and mean you can’t AFK/semi-afk as much.
You should add “Invading Precursor Entities” to your Overview if you haven’t already, and be hitting D-Scan often enough to detect them before they arrive. You might also check this thread for a few more details and info on mining builds:
Triglavian Recon Squad