You seem to be confused about terminology. I often find that it helps to look at source code. For instance, have a look at how Transformer is implemented in PyTorch 23. The Transformer itself is both the whole encoder and the whole decoder and they both consist of N layers where each layer is the typical multiheadattention layer with dropout and normalisation (it’s all there in the source code). In LMs we often only use the encoder.
The image that you post is just an illustrative example, not a visualisation of the actual architecture. E1 is the input embedding of the first token, E2 the embedding of the second token, and so on. These are fed into your transformer encoder (here you have two encoder layers) but in reality BERT has more layers, depending on the model size.
You should not use the hidden layer size like that. That’s not what it typically refers to.  The blue cells are not individual encoders either, each row of blue circles is a single encoder layer and every layers outputs hidden_dim*n_tokens to the next.
I suggest you re-read the transformer paper followed by the BERT paper.