It's based on lag. If you have a higher latency, the window that you can begin to move and not cancel the cast is larger, and vice versa.
So just do some tests on a target dummy and try moving right at the very end of a spell cast but before it finishes. If it says interrupted, you moved too early.