Can you write a function to identify duplicate transactions in a dataset, and explain how you would do it efficiently for Affirm?
Implement identify_duplicate_transactions(transactions). The input is a list of dictionaries, each containing a string transaction_id. Return a list of transaction IDs that occur more than once, ordered by their first duplicate appearance. Each ID should appear only once in the output.
def identify_duplicate_transactions(transactions):