Its a bit complicated but the general principle is below. Note: This code is a sample only as I do not have your database to test against and it is missing additional information you need.
First off it is easier to create a view below to show how to get the data into different columns. it will need to be changed to include additional data and filters as needed.
eg
SELECT top 2
case when row_number() over(order by Transactiondate) = 1 then Transaction else '' end as [Current],
case when row_number() over(order by Transactiondate) = 2 then Transaction else '' end as [Previous],
row_number() over(order by eventdate) as row
FROM customer_transaction
Then combine the text fields (one will be '' and one will have the data) into a single row.
eg
SELECT STUFF((SELECT ',' + [Current] FROM View1 FOR XML PATH('')) ,1,1,'') AS [Current], STUFF((SELECT ',' + [Previous] FROM View1 FOR XML PATH('')) ,1,1,'') AS [Previous]
Once you have sorted out these two they can be combined to create one large statement.
A good article on the second part is
Converting row values in a table to a single concatenated string - SQLMatters[
^]