You can hook when entities are created (but I'm not sure it will work with plugin-created entites). Also, use a dynamic array if you need to have an array with unknown length.
If you are trying to store info about EVERY entity then there is probably something wrong with the approach to your goal.
It seems that this may be yet another XY problem. Please explain what your end goal is without saying how you are trying to accomplish it.