Time Machine can be configured to exclude folders from your backups (see System Settings > General > Time Machine > Options). I usually exclude these:
- ~/Library/Developer/Xcode/iOS DeviceSupport
- ~/Library/Developer/Xcode/tvOS DeviceSupport
- ~/Library/Developer/Xcode/watchOS DeviceSupport
Also, if you need to make space to be able to install Xcode or a macOS update, you can delete the contents of the above folders (assuming you no longer need old device SDKs).