If you sell on exchange from which HMRC get information then they will know, but if you buy on Coinbase (UK), and then transfer coins to hardware wallet, hold coins for some time and sell to your friend for fiat, then how they can prove anything? It is not easy to prove that coins have changed ownership, they can just be moved from one address to another.
You need to pay tax if any profit is realized, but it depends from country to country. If you never sell crypto on one of those three exchange offices, then they only can see that you buy crypto and send it to some other address. I doubt they will follow a trail of money on blockchain, but the dots could easily be connected if you buy one exchange, transfer coins to other exchange and then sell for fiat.