This is how it works with other assets. If you transfer stocks between brokerage accounts, they communicate the basis as well.