You can, but you are in high risk of stressing your plant out big time, and it turning hermi on you. Which result in seeded buds, and when the female gets pollinated by the male and seeds start growing, THC production stops.

So no, I would not recommend taking a cutting from a flowering plant.