Make two left joins on TransferDetail with DepartmentUser one for the key TransferByFrom and 2nd for the key TransferByTo
As below
select TID, TransferByFrom=frm.fname, TransferByTo=To.Fname,Date
from TransferDetail TD
Left Join DepartmentUser frm On TD.TransferByFrom=frm.DUID
Left Join DepartmentUser To On TD.TransferByTo=To.DUID