That cable should work fine as that is the method documented by Apple as a supported means to transfer data. The link provided by @nohillside documents this, and I repeat it here in case of a deletion or edit and for sake of completeness: https://support.apple.com/en-gb/guide/mac-help/mchlb37e8ca7/12.0/mac/12.0
For those with a similar concern on pre-M1 computers Apple documents the process here: https://support.apple.com/en-gb/guide/mac-help/mchlp1443/12.0/mac/12.0
USB should work fine for this, as should FireWire or Thunderbolt cables if that is what you have on hand. I have done this process on Apple Intel hardware so I am quite certain this works. I have not done this with the new Apple silicon hardware so if I am mistaken on this working with FireWire and Thunderbolt then I'd appreciate a correction/clarification.