You can assign your data to a \vbox and then extract the first box with \vsplit. It is quite hacky and probably fails if your box does not start with text and it only gives you the box. So in contrast to the solutions in Changing the style of the first *typeset* line of a paragraph you can't change the formatting anymore, but the spacing is preserved:
\documentclass{article}
\usepackage{lipsum}
\newbox\mylocalbox
\newbox\myglobalbox
\def\Ggetfirstline{%
\vfuzz\maxdimen
\setbox\mylocalbox=\vsplit0to1sp
\setbox\mylocalbox\vbox{%
\unvbox\mylocalbox
\global\setbox\myglobalbox\lastbox
}%
\endgroup
\box\myglobalbox
}
\def\Getfirstline{\aftergroup\Ggetfirstline}
\def\getfirstline{\begingroup\afterassignment\Getfirstline\setbox0\vbox}
\setlength\parindent{0pt}
\begin{document}
\lipsum[2]
\vspace{1.5cm}
\getfirstline{\lipsum[2]}
\end{document}
This code inserts the first line as the same type of box as it originally was, normally a \hbox. You can also keed the box wrapped in a vbox to keep horizontal displacement in place:
\documentclass{article}
\usepackage{lipsum}
\newbox\mylocalbox
\newbox\myglobalbox
\def\Ggetfirstline{%
\vfuzz\maxdimen
\setbox\mylocalbox=\vsplit0to1sp
\global\setbox\myglobalbox\vbox{\unvbox\mylocalbox}
\endgroup
\box\myglobalbox
}
\def\Getfirstline{\aftergroup\Ggetfirstline}
\def\getfirstline{\begingroup\afterassignment\Getfirstline\setbox0\vbox}
\setlength\parindent{0pt}
\begin{document}
\lipsum[2]
\vspace{1.5cm}
\getfirstline{\lipsum[2]}
\end{document}

If you are open to use LuaTeX, you can use Lua to create a more general and robust macro which always gives you the first box in the current vertical list, even if you are in the main vertical list: (This is in plain LaTeX, just add \documentclass, \begin{document}, \end{document} if you prefer LuaLaTeX)
\def\setboxtovhead{\directlua{
local vlistid, hlistid = node.id'vlist', node.id'hlist';
local vlistlevel = tex.nest.ptr;
while math.abs(tex.nest[vlistlevel].mode) \csstring~= 1 do
vlistlevel = vlistlevel - 1
end
local nest = tex.nest[vlistlevel]
local head = nest.mode == 1 and tex.lists.page_head or nest.head.next;
while head and head.id \csstring~= vlistid and head.id \csstring~= hlistid do
head = head.next
end
tex.box[token.scan_int()] = node.copy(head)
}}
\parindent0pt\parskip1em
abc\hfil\break def\hfil\break ghi
\setboxtovhead0
The first line was:\par
\box0
\end

tex-core... but two packages instead... Feel fre to ask me delete it... Also I am not sure if the term 'first box' is the 'first item' as in my answer... If so, please edit your post to correct 'box' to 'item' – koleygr Jul 05 '18 at 11:47