How to make pg_basebackup use temporary replication slots
The slot to use for -X stream is specified with the --slot option. Its documentation says:


  If this option is not specified and the server supports temporary replication slots (version 10 and later), then a temporary replication slot is automatically used for WAL streaming.