So I have 7 months left on my lease, and my lease says If I leave early I must pay every month of rent plus a $2,500 fee. But what if I just move out and continue to pay rent each month for the remainder of my lease and get my deposit back in a few months. Is that legal? The apartment would be empty and I won’t live there but I will pay rent each month and avoid the $2,500 fee by continuing to pay rent. Can someone tell me if I can do this or not. My lease does not say anything about it.
Signing the lease and paying the rent entitles you to use of the space, but doesn't require your presence. Your lease may specify that you must occupy the unit and not leave it empty/abandoned, but you state that there is nothing like that in your lease. As long as nothing in your lease says you can't leave the apartment empty, and you don't mind paying the rent (in addition to whatever rent/mortgage you pay for your new place), then go ahead.
However, this is likely not optimal. In some jurisdictions (you don't mention where in the world you are), these terms would not be legal, or not practically enforceable. Some laws require the landlord to make an effort to find a replacement tenant, and you aren't liable for any rent once there is a new tenant. Considering the amount of money involved (the fee and the 7 months' rent), it's worth it to consult with a lawyer (local and familiar with rental/leasing law, not people on the internet) about your options for getting out of the obligations in the lease. If they can help, the money you save will likely more than cover their fee.