In magnetically confined plasmas, the second derivative of the density is known to be related to the E × B velocity shear that rules the transitions to improved confinement regimes. In this work we present a cellular automata model for transport that includes diffusion and avalanche-like mechanisms controlled by critical parameters. Assuming the hypothesis that a strong negative value of the second derivative of the density reduces the strength of avalanches, the model shows the emergence of different confinement regimes that are found to be analogue to low (L), high (H) and very high (VH) confinement modes in real plasma. Transitions between such regimes can be controlled by the parameter representing the fuelling intensity. In particular, the model reproduces the formation of a pedestal during the transition from L to H confinement regimes, and shows hysteresis phenomena.