Markov Process - formulate a Markov chain model for this system ( what is q(i,j)?)

Potential customers arrive at a full-service, two-pump gas station according to a Poisson process at a rate of 40 cars per hour. There are two service attendants to help customers, one for each pump. If the two pumps are busy, then arriving customers wait in a single queue, to be served in the order of arrival by the first available pump. However, customers will not enter the station to wait if there are already two customers waiting, in addition to the two in service. Suppose that the amount of time required to service a car is exponentially distributed with a mean of three minutes.

I wonder how to find Markov chain model, which equivalently asking what is q(i,j) for state spaces for this problem. This is textbook question, and the textbook question is asking for long run fraction, and the solutions are easily found on google, but I wonder how to find the generator matrix q(i,j). Thanks!

You can define the state space as the number of customers in the station: $S=\{0,1,2,3,4\}$. This assumes that the pumps are identical (a slight modification can be made if this is not true, as long as the service is still exponentially distributed).
The arrival rate is $$q(i,i+1)=40, \ for \ i=0,1,2,3.$$
The departure rate depends on the state: when only one customer is present then the server is working we have a 20 per hour rate (3 minutes service), but when both are working we have a 40 per hour rate. When there are at least two customers then the rate is 40. So we get: $$q(i,i-1)=\max\{20i,40\}\ for \ i=1,2,3,4.$$