Not that difficult, actually. The company pays a tariff on the specific product being imported, which would have been recorded. Customers who then buy those products should receive itemized receipts, either physically from a store or electronically via email when buying online. The receipt should also indicate a payment method that can likely be matched to a bank statement if needed.
Match the itemized receipt to the tariffs paid, there you go.
The harder part is directly linking the tariffs paid to the price the consumer paid. The tariffs were inconsistent and changed a few times, and we don't know if all price increases were caused directly by tariffs or if there were other factors as well. Moreover, some companies ate the cost in some cases, notably Nintendo, who chose not to increase the original pre-tariff price of the Switch 2, but did for Switch 1 and accessories for both systems. Nintendo will likely be refunded for all of those, but not all of that was a cost passed on to the consumer, so it's hard to figure out at that specific a level.
This lawsuit is definitely going nowhere, at any rate, so this is basically all just idle musing.