Set up a script to perform a find on your Stock Table. This script can copy the Stock record's Primary key to a variable and then create a new record in the transaction table and set the record's foreign key to the value of this field.
You can also add a new occurrence of the Stock table to your relationship graph and link it by Part Number to your transactions table. You can set up a Looked Up Value auto enter option on the foreign key field to copy over the Part ID when the part number matches.
Can you elaborate a bit more on the Looked Up Value Auto Enter option? FM only allows me to copy over the field that has a match. For instance, if PartID matches, i can copy that but not Part Number?