Generally Publishers, be they publishing journals or books, request that authors transfer all their rights to the publisher before a work is published.
You DO NOT have to do this.
When publishing a scholarly work, either a book or a journal article, the reality is that publishers only really need the right of first publication i.e. a period of exclusivity that allows them to produce and disseminate the work without hindrance. This is something that could be achieved via an embargo period negotiated prior to publication.
You are allowed to do this because it is possible for authors to license the specific rights to publishers that are necessary them to publish your book or journal article while retaining other rights making it easier for you, as the author to reuse and distribute your work on platforms like the CSHL Institutional Repository.
This is a process known as "unbundling" and can easily be achieved by an author negotiating with any publisher
To learn more about Author Copyright and how to unbundle your rights for publication you can view the Copyright and author rights Powerpoint presentation on the ACRL website. This provides a brief overview of their rights as authors.
To learn about how to negotiate with publishers to preserve your rights go to the SPARC's Author Addenda site. This provides examples and guidance on how to use an author addendum to preserve your rights when negotiating with a publisher