How is transformer size decided?

From your assessed maximum demand, with diversity applied, plus reasonable growth allowance. On shared connections the combined demand across all parties is assessed together, which is far more efficient than adding individual figures.