The idea with animals being "territorial" is actually quite good and corresponds to real life. Let's consider the 2 most common scenarios when an animal attacks a human / hearthling IRL
1.) If you are threatening it by attacking it or just by being in its territory. Then the animal will first warn you and then attack you and its goal is to drive you away from its territory. So let's say the forest it is in. It won't chase you farther away since it completed its goal and thus will de-aggro.
2.) It wants to eat you. So it will chase you until you get away or you're dead (same mechanic as is now). This should be extremely rare though, since even bears don't pick humans as their pray in most cases.
So my suggestion is to implement a mechanic where the animals de-aggro if you run far away from the spot it aggroed you (not far away from the animal itself). Preying animals should only be: A pack of wolves, bears (but with a low chance), trolls. If you want to expand this list then also add badgers (cause badgers don't give a fuck), and goats cause they are vile satanic creatures. Everything else pls put as territorial.