In Database / Database Manager / Database Manager then Virtual Layers / Qgis Layers you can try the following query to create your line layer :
select a.id, b.id, make_line(st_centroid(a.geometry),st_centroid(b.geometry)) as line from animal_locations a, animal_locations b
you save the result (Care about the size of your dataset) ...
Then, as @csk indicated, you edit this layer by adding a virtual field using the following expression :
RefFunction plug-in required to access this expression ... And you should have the answer you're seeking.