Browsers and servers agree on HTTP/2 during the TLS handshake, using an extension called ALPN. s_client can offer a protocol list and show what the server chose.
Offer HTTP/2 and look for the ALPN line:
echo | openssl s_client -connect example.com:443 -servername example.com -alpn h2 2>/dev/null | grep -i alpn
echo | openssl s_client -connect example.com:443 -servername example.com -alpn 'h2,http/1.1' 2>/dev/null | grep -i alpn
When the server supports it, you see ALPN protocol: h2. If it does not support anything you offered, the line reads No ALPN negotiated, and a browser would fall back to HTTP/1.1.
This is a lower level view than asking curl for the HTTP version. It shows the decision of the TLS layer only, before any HTTP request is sent. I find it useful when a reverse proxy sits in front of a service: the proxy is where ALPN happens, so the answer tells you what the proxy offers, whatever runs behind it.
HTTP/3 does not show up here. It runs over QUIC on UDP, not over this TCP connection, and servers announce it in an Alt-Svc header or a DNS HTTPS record instead. Also, a server may accept h2 in the handshake and still answer badly over HTTP/2, so a real request is the final test.
Further reading: OpenSSL: openssl-s_client, RFC 7301: TLS ALPN extension
Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get