You can make unlimited transactions, but each sell or buy has a fixed cost. For example:
given the prices [1, 3, 6, 5, 8], cost = 1, the max profit is 5. To see this, you can buy at 1 and sell at 8 to get a profit of 7, minus the transaction cost 2, and the final result is 5.