From Marrakech, you can either rent a car or go the authentic way and take a "Grand Taxi". This is a big mercedes shared by 7 people (and possibly a chicken?).
To get to the Bougmez Valley you need to take two taxis,
Marrakech -> Azilal, Azilal -> Tabant. Taxis only leave when full, so if you want more space or want to leave early you can buy as many seats as you want. (a 200km journey will cost you between €5-€8 per person but the price is fixed)