Once you cast Soul Transfer and choose both modes, it doesn't matter what happens to the artifact or enchantment you control in response. Soul Transfer will still have both modes chosen.

Artwork
Loading artwork…
Soul Transfer
Kamigawa: Neon Dynasty · #122 · EN
Nonfoil—Foil—
Card rules
Choose one. If you control an artifact and an enchantment as you cast this spell, you may choose both instead.
• Exile target creature or planeswalker.
• Return target creature or planeswalker card from your graveyard to your hand.
Rare · Illustrated by Lorenzo Mastroianni
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
The artifact and the enchantment may be the same permanent.