Yes, it was legal
< (2 of 3) Next position >
Parliament is the master of its own proceedings
Parliament alone decides when it will sit and when it should be prorogued. As leader of the majority party, Boris Johnson is allowed to prorogue parliament whenever he chooses.
< (1 of 2) Next argument >
It is up to Parliament to decide when it sits and when it is prorogued. As the Prime Minister and head of the party with the most parliamentary seats, Boris Johnson was within his legal rights to prorogue parliament.
Boris Johnson, as Prime Minister and the leader of the majority party in parliament (or the head of the governing coalition of parties), was within his rights to prorogue parliament. It is up to parliament and MPs to decide when they sit. If the public does not like it, they can hold MPs, and Boris Johnson, to account by expressing their displeasure at the ballot box. 
Where does it end? If we accept that the prime minister has the power to determine when the parliament, what is to stop a prime minister from proroguing parliament for weeks, months, or even years at a time? The prime minister does not have unlimited legal authority to prorogue parliament indefinitely. They are constrained by legal precedents and the constitution. There is no legal precedent for the prorogation of parliament for 33 days. Nor is Johnson permitted, within the constitution, to prorogue parliament for the purpose of stymying debate and bypassing the democratic process. 
[P1] Parliament decides when it sits and when it is prorogued. [P2] As the head of the governing coalition, Boris Johnson is free to make that decision. [P3] Therefore, he was within his legal rights to prorogue parliament for as long as he saw fit.
Rejecting the premises
[Rejecting P2] But Boris Johnson is bound by the constitution and legal precedents. [Rejecting P3] His prorogation was a break with convention and in breach of the constitution.