You have a couple options.
You can install the baseboard, caulk, paint the caulking with your trim paint and then try to cut a straight line with your wall paint. This will likely be a challenge.
As a painter, this is what I would do:
Install the baseboard, caulk, paint the caulk line with the wall paint. Try not to get your wall paint all over the base, especially if the colors are drastically different. Let the paint dry/cure for a day. Get yourself some delicate surface Frog Tape and tape the wall, right above the baseboard and then come back with your trim paint and brush the top of your base (this make take more than one coat depending on color differences). Frog Tape has a water activated polymer that swells when latex paint hits it and prevents tape bleed and will give you nice sharp lines.
Frog Tape
PaintBlock® Technology is a super-absorbent polymer that reacts with the water in latex paint to form a micro-barrier. This seals the edges of the tape to prevent paint bleed and deliver super sharp paint lines.