If the matrix you are optimizing is 10^5x10^5, MATLAB typically has no problems if it is very sparse.
However, the 10^5 x 10^5 matrix you are talking about is the matrix obtained for a particular value of the variables parameterizing it. The solver, and YALMIP needs some way to represent this parameterization. Basically, the indicies specifying that element (i,j) has the kth variable x(k) (times some scalar). The way many solvers represent this is by simply stacking the base matrices in one large (10^5*10^5)*numberofvariables matrix. That way, the whole indexing magic is kept trivial, it is taken care of by the underlying sparse support. Getting the matrix for a particular x, is simple reshape(B*[1;x],n,n) etc.
However, sparse matrices take up a lot of memory, even when it is completely empty. There is always an overhead, and this overhead is linear in the number of columns. Hence, if B is transposed, memory use explodes. YALMIP performs transpose sometimes to speed up some operations which are done faster columnwise than rowwise, and then you sink MATLAB. I will try to safeguard the code though, and detect these memory issues and go for (possibly horribly slow) operations on the original form.
B = sparse([],[],[],(1000)^2,1000);
X = B';
whos
Name Size Bytes Class Attributes
B 1000000x1000 8024 double sparse
X 1000x1000000 8000024 double sparse
Finally, a 10^5 x 10^5 SDP would never be solved by Mosek, or any other traditional SDP solver. Since most solvers are primal dual second-order solvers, they will have to introduce a dual variable somewhere, and this will typically be a dense 10^5 x 10^5 matrix, requiring 80GB just to store. Operations on this involving O(n^3) operations would also be frying the processor. When going above dimensions of some thousands, purpose-built first-order solvers etc are required.