Does not look like it is forbidden to declare a different major, but there is the expectation that you will declare a major as soon as possible, possibly noting the major that you listed on the transfer application. In some cases, you may be given registration priority for needed courses for the major you listed on the transfer application, but not other majors.
https://ls.berkeley.edu/advising/planning/schedule-planning/transfers-berkeley/transfer-student-faqs