Not a very beautiful notation for my personal taste. Adapting a little bit the code from How to produce a longer \sim with a small letter on top
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
% helper macro I snitched somewhere on this site
\newcommand{\smallerstyle}[1]{%
\ifx#1\displaystyle\scriptstyle\else
\ifx#1\textstyle\scriptstyle\else
\scriptscriptstyle\fi\fi
}
\newcommand{\xsim}[1]{\mathrel{\mathpalette\x@sim{#1}}}
\newcommand{\x@sim}[2]{%
\sbox0{\m@th$\smallerstyle#1,#2,$}%
\sbox1{\m@th$#1\sim$}%
#1\mathop{%
\ifdim\wd0>\wd1
\resizebox{\wd0}{\height}{\box1}%
\else
\box1
\fi
}\limits^{#2}%
}
\makeatother
\begin{document}
$A \xsim{a} B \xsim{a\to0} C$\par\medskip
$\sin(x) \xsim{x\to0} x$
$\scriptstyle \sin(x) \xsim{x\to0} x$
$\scriptscriptstyle \sin(x) \xsim{x\to0} x$
\end{document}
