There are 2 ways to go about intersecting the triangle. Let the vertices of the triangle have positions $v_1, v_2, v_3$. Let the ray have origin $o$ and direction $d$. Let the model (4x4) matrix be $M$. To find the new vertex coordinates one extends the positions with a 1 (to allow for translations) and multiplies by the model matrix. Let $u_i = (v_i.x, v_i.y, v_i.z, 1)$ then $w_i = Mu_i'$. The resulting vertex positions are: $v_i' = (w_i.x, w_i.y, w_i.z)$. The other option is to transform the ray with the inverse matrix $M^{-1}$ and intersect with the non-transformed triangle. To achieve this extend $o$ with a 4th coord of 1 (to account for translation) and extend $d$ with a 4th coord of 0 (to ignore translation) then multiply both with $M^{-1}$: $$o' = M^{-1}(o.x, o.y, o.z, 1)$$ $$d' = M^{-1}(d.x, d.y, d.z, 0)$$ Drop the 4th coordinate of $o'$ and $d'$ then intersect with the triangle formed by $v_1, v_2, v_3$.