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.
Remove any tiny seedlings by snipping them off at the base of the stems. But don’t throw them out—use them in a salad as microgreens!
Keep the basil well-watered (but not water-logged) to reduce the effects of transplant shock.