I point out that
\hl{\hspace{5cm}}}
produces an error, regardless of the use of transparency. However, one can use a \rule to achieve a blank field and with the added use of \transparent, that colored rule field can become transparent.
After some confusion on my part seemingly related to multiple compilations required for the transparent package, it seems to work.
Take this MWE:
\documentclass{article}
\usepackage{soul,xcolor}
\usepackage{transparent}
\sethlcolor{red}
\begin{document}
\leavevmode
\rlap{hi mom how are you?}%
\transparent{.6}{\hl{xyz}\color{yellow}\rule{1in}{2ex}}
\end{document}
I get something that looks like I would expect.

If I change the \transparent parameter to .1 and perform the requisite numbers of compilations, the result changes to

which also follows what the package is apparently supposed to do. As the transparency approaches unity, the red and yellow fields become opaque.
\hl{\hspace{5cm}}does not appear to valid syntax, even in the absence of thetransparentpackage. – Steven B. Segletes May 02 '21 at 19:20\hspacein the\hlargument, perhaps an alternative is to use a\rule, as I show in my answer. You can adjust the rule depth and height to suit. – Steven B. Segletes May 03 '21 at 09:45