Boris Johnson has hit out at the Supreme Court for intervening in a political matter at a time of "great national controversy" over Brexit.