Evasion is a payment power that you cn use whenever you have priority and can pay the cost.
Since you will get priority during the attack proposel and during the actual attack, you can use it either time.
If you are the defender and you use evasion, don't forget, when you go to attack conclusion, the attack will ready because the defender is no longer there.