First thing to think about is that your bank account is absolutely unique to you. Does the store keep records of what you bought? Does it keep identifiers of the product or the person buying it, where they bought it? This could apply for any product you bought in a store, not just phones too.
Some retailers based on country will require some degree of KYC before they even sell a phone to you -- usually the phone stores. If you're a customer of their services then they associate the device identifiers to you, before they hand it out to you. So, even if you don't use their mobile network they may already keep record of device IMEI and customer.
If that's a concern, don't buy your devices there.
You could buy a phone with cash and refuse / falsify details if it is that much of a concern. Examples could be to go to a pre-owned device store, thrift store, or buy second-hand from someone else. The identifiers wouldn't be associated to you until you associate that device to your identity later.