Are you sure that’s illegal? I know it’s illegal to make individual purchases without an FFL transfer, but buying from a licensed dealer?
Federal law requires guns be purchased in your home state. You can buy out of state but must have the gun transferred to a dealer in your home state and pick it up there.
The big government statists want all private stopped and no handing down guns through the family.
If you want to buy a gun from an out-of-state source you have to get a licensed gun dealer to ship it to a licensed gun dealer in your state, who will complete the transaction paperwork. I believe those rules came in after Lee Harvey Oswald had obtained his gun via mail order.
I worked for a gun dealer briefly in my younger days.