how do I control duty cycle of a MOSFET using PI controller
It is not easy to explain the whole thing in a simple post like in here. First-off, power supply designers rarely speak about PID coefficients but talk about poles and zeros placement. There are bridges between the two but as a power designer, I am more at ease to place a compensation zero than tweaking a D coefficient : ) Second, before attempting to stabilize anything, you need to characterize the dynamic response of your power stage (a voltage-mode buck-boost converter in your case). This is truly the starting point. That is, what transfer function \$H(s)\$ links my output variable (\$V_{out}\$ or \$I_{out}\$) to my control variable? This is expressed as \$H(s)=\frac{V_{out}(s)}{V_{err}(s)}\$ in which \$V_{err}(s)\$ is the voltage delivered by the compensation block (an op amp or your PID output whose transfer function is designated as \$G(s)\$). By adjusting \$V_{err}(s)\$ you have a means to adjust the output variable. However, as you control your series MOSFET through a duty ratio \$D\$ which is defined as \$D=\frac{t_{on}}{T_{sw}}\$, you need another block to convert the error voltage into a duty ratio. That block is called a pulse width modulator (PWM) and is shown below



This is what is called a naturally-sampled modulator and considering a perfect comparator its small-signal gain is simply \$\frac{1}{V_p}\$. It works by comparing the dc voltage \$V_{err}\$ with a ramp (whose peak amplitude is \$V_p\$) and when both meet, the comparator toggles. By changing \$V_{err}\$ you change \$D\$. I believe you may find a block like this in Simulink (https://fr.mathworks.com/help/slcontrol/ug/models-with-pulse-width-modulation-pwm-signals.html?requestedDomain=www.mathworks.com).

You can obtain your power stage transfer function in many ways: analytical analysis, simulation with average models, bench experiments etc. but you need it before attempting to do anything. When you have it, you select a crossover frequency and calculate the pole-zero placement (or the PID coefficients) in the compensation block \$G(s)\$ to shape the loop gain \$H(s)G(s)\$ and build the desired phase and gain margins. That sounds complicated but it's not : ) 

Please have a look at a seminar I taught at APEC a while ago which describes the link between PID and poles/zeros and gives a lot of compensation examples: http://cbasso.pagesperso-orange.fr/Downloads/PPTs/Chris%20Basso%20APEC%20seminar%202012.pdf. You will also find numerous other seminars on small-signal analysis and power stage characterization here http://cbasso.pagesperso-orange.fr/Spice.htm. Good luck with your circuit!