This article shows great examples and goes over the process, which is very simple: pin the item into the desired shape, then use a hair dryer on the high setting, being careful not to burn the yarn.
Beware, this will change the drape of the fabric and the look/feel of your garment.
I’d never use acrylic yarn for a baby, since babies can’t regulate their body temperature well enough. Wool or wool/nylon-blends are a better choice :)