It's a random drop, with a high chance to drop from hay stacks I think.
Some traders or non-trader npcs might have wheat for sale.
I my XC_Bags mod, wheat is sold by the veggie vendor at the Cyseal market but using that mod would require a game restart unfortunately.