I'm not sure what do you exactly mean by "how" but when I was doing some modeling of PEM systems in Matlab/Simulink environment I found book by Colleen Spiegel "PEM Fuel Cell Modeling and Simulation Using Matlab" to be helpful.
Back in the days, S.M. Sharifi Asl, S. Rowshanzamir, M.H. Eikani, Modelling and simulation of the steady-state and dynamic behaviour of a PEM fuel cell, Energy 35 (2010) 1633-1646 and
K.H. Loo, K.H. Wong, S.C. Tan, Y.M. Lai, Chi K. Tse, Characterization of the dynamic response of proton exchange membrane fuel cells - A numerical study, International Journal of Hydrogen Energy 35 (2010) 11861-11877 were also useful.
In Matlab Simulink, there is an inbuilt fuel cell block, consisting of various fuel cell types (PEM, SOFC, MCFC etc.) You can PEM Fuel cell directly from it and vary the parameters as per your requirement.
Another option for modeling PEM fuel cell is to adopt mathematical modeling by considering the equations. The above answer has given few paper details where you can find the required mathematical equations.
GT Suite 2019 does has PEM Fuel cell better performance in short time compared to other custom tools. Vehcile integration is also possible for detailed performance.