Table with two customer IDs that I want to relate to the entity
You want to get names matched to two separate fields. 

Fields are indepentent. 

So the tables which are used to find relative names must be independent too. 

So you need 2 separate copies of names table: 

SELECT tr.*, 
       n1.name AS buyer_name, 
       n2.name AS seller_name 
FROM transactions AS tr 
JOIN names AS n1 ON tr.buyer = n1.id 
JOIN names AS n2 ON tr.seller = n2.id