In answer to your question, the transfat creation occurs in
a bulk reaction vessel at a food processing factory when they take poly and mono unsaturated fats like soybean oil and hydrogenate them into saturated / trans fats like shortening to prolong shelf life and «improve» texture.