Turn it around and think of it another way: a "transaction" is just an exchange of energy and resources. Drop a piece of sodium into a glass of water and a series of very explosive transactions will take place on the molecular level. Put a piece of raw meat on top of a slab of very hot metal and the meat will absorb some of that heat and be chemically changed by it; that's a transaction and an investment.
Communication is a transaction in its purest form. I make a noise that has a specific meaning, you hear the noise and it causes a reaction in your brain. The reaction causes you to make a noise that has a specific meaning and hearing that noise causes a reaction in my brain. It's just two people making noises in order to affect each other. Sex is similar as a form of communication; the way you touch each other, the way you respond to each other, the way you interact with each other moment by moment. If you aren't particularly expressive, then it's kind of boring, and if your partner isn't very receptive then she'll miss half of what you're tying to do. On a more basic level it is (or can be) a transaction of bodily fluids and genetic material and the interaction of the exchange can affect both partners, although it affects one more strongly than the other if you do things right.
Yes, relationships are often contingent on things like finances and genuine emotion, but the relationships where partner's actually treat each other like bank accounts they can debit from, are usually the shittiest relationships, with the shittiest people, who end up divorced.
Relationships are only as stable as the thousands and thousands of tiny transactions between the two people are still profitable for both of them. Sometimes the relationship is purely based on finances, but because that relationship remains profitable it can last a very long time. It's when OTHER forms of interaction between them become unprofitable that problems occur; maybe your relationship started out purely as financial convenience and you otherwise ignored each other. That's fine, but it's not sustainable; you have to talk to each other occasionally, and if there's kids involved you have to deal with each other more than occasionally. Those couples either find ways to interact that is beneficent to both of them, or they clash and wind up hating each other.
The point is, ALL of their interactions -- or at least the aggregate of them -- has to be profitable for both partners involved. In the case of prostitution, this is easy: I give you money, you give me sexual gratification. In the case of casual sex, this is also easy: I give you sexual gratification, you give me sexual gratification. The deeper the relationship, the more complex and less tangible the things being exchanged, the easier it is to get it wrong.