I suppose it's possible by means of measurements of /interface/monitor-traffic interface=wan do=route.to.link2.script
the script is not trivial at all, meaning all current connections must persist, and new connections should be made over link2.
This can be achieved by routing marks (not script) in firewall rules and routing tables.
Routing table should be manipulated correctly (by script), to allow traffic go to link2 only if overflow traffic exists for some reasonable period of time.
Connections through each link must be marked (to make same address reply possible) and maintained until they alive (via routing and connection marks).
Links reachability should be monitored by recursive routing and result of this monitoring can be obtained in script.
New connections will go through link2 (by means of routing table metrics) only if overflow occurred and drop back to link1 after overflow is gone.
Of course, measurements will be approximate, but this is what I can suggest.
:put ([/interface/monitor-traffic interface=wan as-value once]->"rx-bits-per-second");