GNU tar(1) does this by stat(2)ing before and after reading from the file. If the ctime changed‡, a warning is printed.
From the mailing list thread about annoying stuff in Borg.
‡ this is platform dependent and needs to be handled different on Windows.