Mean field theory of self-organized critical phenomena