To increase the chances of your herb surviving, it should be moved into a larger pot or into the ground the week it’s brought home.
Supermarket herbs won’t do well if you just take them out of the pot and put them straight in the ground (or into a larger container). You need to divide them first.
To keep your plants healthy, gently prod the root ball apart with your hands or cut them with a clean pair of shears. I usually leave two to three seedlings per transplant, and remove the weaker ones as the plant matures.
Remove any tiny seedlings by snipping them off at the base of the stems. These seedlings will never be able to survive in the shade of their taller neighbors. But don’t throw them out—use them in a salad as microgreens!
Just like you do with tomatoes, plant the basil up to its lowest set of leaves (even removing the last set if it’s starting to yellow) to encourage roots to form along the stem.